package com.smart.four.ioc.lifecycle.applicationcontext;

import com.smart.four.ioc.lifecycle.applicationcontext.Car;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试bean生命周期
 *
 * @author junrui.wang
 * @create 2018/5/28
 */
public class BeanLifeCycle {
    private static void LifeCycleInBeanFactory(){
        ApplicationContext ac = new ClassPathXmlApplicationContext("com/smart/four/ioc/lifecycle/applicationcontext/beans.xml");
        Car car = (Car)ac.getBean("car");
        car.introduce();
    }

    public static void main(String[] args) {
        BeanLifeCycle.LifeCycleInBeanFactory();
    }
}
